package com.zzgele.qmzb.api.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.zzgele.qmzb.api.core.AbstractService;
import com.zzgele.qmzb.api.dao.NoticeMapper;
import com.zzgele.qmzb.api.model.Notice;
import com.zzgele.qmzb.api.service.NoticeService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Condition;

import javax.annotation.Resource;
import java.util.List;


/**
 * Created by Martin on 2017/07/14.
 */
@Service(interfaceClass = NoticeService.class,proxy="jdk",timeout = 30000)
@Component
@Transactional
public class NoticeServiceImpl extends AbstractService<Notice> implements NoticeService {
    @Resource
    private NoticeMapper noticeMapper;

    public  List<Notice> getNoticeList(int type){
        Condition condition=new Condition(Notice.class);
        condition.createCriteria().andCondition("channel_id="+type  );
        condition.setOrderByClause("seq_no asc");
        List<Notice> list = findByCondition(condition);
        return list;
    }

}
